package com.omt.tarjimdinek.domain.user.Service;

import com.omt.tarjimdinek.domain.user.entity.Utilisateur;
import com.omt.tarjimdinek.support.Repository;
import com.omt.tarjimdinek.support.SearchParameters;
import com.omt.tarjimdinek.web.home.SubscriptionCriteria;

/**
 * The UtilisateurRepository is a data-centric service for the {@link Utilisateur} entity.
 * It provides the expected methods to get/delete a {@link Utilisateur} instance
 * plus some methods to perform searches.
 * <p>
 * Search logic is driven by 2 kinds of parameters: a {@link Utilisateur} instance used
 * as a properties holder against which the search will be performed and a {@link SearchParameters}
 * instance from where you can control your search options including the usage
 * of named queries.
 */
public interface UtilisateurRepository extends Repository<Utilisateur, Long> {

    /**
     * Return the persistent instance of {@link Utilisateur} with the given unique property value username,
     * or null if there is no such persistent instance.
     *
     * @param username the unique value
     * @return the corresponding {@link Utilisateur} persistent instance or null
     */
	Utilisateur getByUsername(String username);

    /**
     * Delete a {@link Utilisateur} using the unique column username
     *
     * @param username the unique value
     */
    void deleteByUsername(String username);

    /**
     * Return the persistent instance of {@link Utilisateur} with the given unique property value email,
     * or null if there is no such persistent instance.
     *
     * @param email the unique value
     * @return the corresponding {@link Utilisateur} persistent instance or null
     */
    Utilisateur getByEmail(String email);

    /**
     * Delete a {@link Utilisateur} using the unique column email
     *
     * @param email the unique value
     */
    void deleteByEmail(String email);
    
    /**
     * Return the persistent instance of {@link Utilisateur} with the given unique property value username,
     * or null if there is no such persistent instance. 
     * @param username
     * @return Utilisateur
     */
    public Utilisateur getUtilisateurByUserName(String aUserName);
    
    /**
     * Create a new User in database
     * @param aCriteria
     */
    public Utilisateur createNewUtilisateur(SubscriptionCriteria aCriteria);
}